package com.csc.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="historytransactions")
public class TransactionHistory implements Serializable{

		/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

		@Id
		@GeneratedValue(strategy=GenerationType.AUTO)
		@Column(name="TransactionId")
		private int transactionId;
		
		@ManyToOne
		@JoinColumn(name="UserImpact")
		private SystemAccount accImpact;
		
		@ManyToOne
		@JoinColumn(name="UserAffected")
		private SystemAccount accAffected;
		
		@Column(name="TransactionDate")
		private String dateTransaction;
		
		@Column(name="ActionTransaction")
		private String actionTransaction;
		
		@Column(name="Command")
		private String command;
		
		@OneToOne
		@JoinColumn(name="StatusId")
		private SystemStatus systemStatus;

		public int getTransactionId() {
			return transactionId;
		}

		public void setTransactionId(int transactionId) {
			this.transactionId = transactionId;
		}

		public SystemAccount getAccImpact() {
			return accImpact;
		}

		public void setAccImpact(SystemAccount accImpact) {
			this.accImpact = accImpact;
		}

		public SystemAccount getAccAffected() {
			return accAffected;
		}

		public void setAccAffected(SystemAccount accAffected) {
			this.accAffected = accAffected;
		}

		public String getDateTransaction() {
			return dateTransaction;
		}

		public void setDateTransaction(String dateTransaction) {
			this.dateTransaction = dateTransaction;
		}

		public String getActionTransaction() {
			return actionTransaction;
		}

		public void setActionTransaction(String actionTransaction) {
			this.actionTransaction = actionTransaction;
		}

		public String getCommand() {
			return command;
		}

		public void setCommand(String command) {
			this.command = command;
		}

		public SystemStatus getSystemStatus() {
			return systemStatus;
		}

		public void setSystemStatus(SystemStatus systemStatus) {
			this.systemStatus = systemStatus;
		}

		public TransactionHistory(String dateTransaction,
				String actionTransaction, String command) {
			super();
			this.dateTransaction = dateTransaction;
			this.actionTransaction = actionTransaction;
			this.command = command;

		}

		public TransactionHistory(SystemAccount accImpact,
				SystemAccount accAffected, String dateTransaction,
				String actionTransaction, String command,
				SystemStatus systemStatus) {
			super();
			this.accImpact = accImpact;
			this.accAffected = accAffected;
			this.dateTransaction = dateTransaction;
			this.actionTransaction = actionTransaction;
			this.command = command;
			this.systemStatus = systemStatus;
		}
		
		public TransactionHistory() {
			super();
			// TODO Auto-generated constructor stub
		}
		
		
}
